# Maintainer:
pkgname=protoc-gen-js
pkgver=3.21.2
pkgrel=1
pkgdesc="protoc-gen-js javascript protobuf generator"
url="https://github.com/protocolbuffers/protobuf-javascript"
# bazel
arch="x86_64"
license="BSD-3-Clause AND Apache-2.0"
depends="protoc"
makedepends="bazel"
source="$pkgname-$pkgver.tar.gz::https://github.com/protocolbuffers/protobuf-javascript/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/protobuf-javascript-$pkgver"
# bazel stuff, no tests
options="net !check"

build() {
	# prevent broken ccache use
	JAVA_HOME=/usr/lib/jvm/java-11-openjdk \
	PATH=/bin:/usr/bin \
		bazel build plugin_files
}

package() {
	install -Dm755 bazel-bin/generator/protoc-gen-js -t "$pkgdir"/usr/bin
}

sha512sums="
afe5b16d1161a6a5e981976bfbdeaacdfcf6909126e55ee35f2513c3267c27870bde9fcd34fbd6aec22c79c41c975b643e26e24ce00b46c1814dfff24f542d48  protoc-gen-js-3.21.2.tar.gz
"
